import { defineStore } from 'pinia'
export const useUserStore = defineStore('user', {
  state() {
    return {
      userinfo: {
        id: 0,
        role: 'user',
        remark: '',
        avatar: '',
        username: '',
        name: '',
        gender: 1,
        phone: 0,
        email: ''
      }
    }
  },
  actions: {
    initUserInfo() {
      this.userinfo = {
        id: 0,
        role: 'user',
        remark: '',
        avatar: '',
        username: '',
        name: '',
        gender: 1,
        phone: 0,
        email: ''
      }
    }
  },
  persist: {
    enabled: true
  }
})